<%@page import="com.zhuoshi.bean.ManagerRoleBean"%>
<%@page import="com.zhuoshi.dao.ManagerRoleDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String id = request.getParameter("id");
ManagerRoleDao dao = new ManagerRoleDao();
ManagerRoleBean bean = dao.getModel(Integer.parseInt(id));
if(bean!=null){
	if(bean.getSys()!=1){
		int rows = dao.delete(Integer.parseInt(id));
		if(rows>0){
			out.print("<script language='javascript'>alert('删除成功');location.href='rolelist.jsp';</script>");
		}else{
			out.print("<script language='javascript'>alert('删除失败');</script>");
		}
	}else{
		out.print("<script language='javascript'>alert('超级管理不能被删除，删除了谁给你分配权限');location.href='rolelist.jsp';</script>");
	}
}
%>
